package com.zrrd.gmall.cart.fegin;

import com.zrrd.gmall.common.result.Result;
import com.zrrd.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@FeignClient("service-cart")
public interface CartFeginClient {
    //添加购物车
    @PostMapping("api/cart/addToCart/{skuId}/{skuNum}")
    public Result addToCart(@PathVariable("skuId") Long skuId,
                            @PathVariable("skuNum") Integer skuNum);

    //查询用户选中的购物车数据
    @GetMapping("api/cart/getCartCheckedList/{userId}")
    public List<CartInfo> getCartCheckedList(@PathVariable("userId") String userId);

    //更新最新价格
    @GetMapping("api/cart/loadCartCache/{userId}")
    public Result loadCartCache(@PathVariable("userId") String userId);
}
